package commands;

import bot.CommandBot;

public class Leave implements Command {

	public String getCommandName() {
		return "leave";
	}

	public boolean execCommand(String channel, String sender, String login,
			String hostname, String message, CommandBot bot) {
		if(message.equals("")) {
			part(login, bot);
			return true;
		}
		return false;
	}

	@Override
	public boolean execCommand(String sender, String login, String hostname,
			String message, CommandBot bot) {
		if (message.equals("")) {
			part(login, bot);
			return true;
		}
		return false;
	}
	public void part(String login, CommandBot bot) {
		if(((CommandBot) bot).getMaster().checkMaster(login)) {
			bot.partChannel(login);
		}
	}
}
